		/*
		 * modify Ajax
		*/
    var modifyInputBox = {};
    $(document).ready(function(){
      modifyInputBox.input = $("#modifyInputBox");
      modifyInputBox.originalValue = "";
      modifyInputBox.goHome = function(){
        $(modifyInputBox.input).appendTo("#modifyInputBoxContainer");
      }
      modifyInputBox.isEdit = function(){
        if(findUpElement(modifyInputBox.input,"td").length > 0){
          return true;
        }
        return false;
      }
      modifyInputBox.value = function(){
        return $(modifyInputBox.input).val();
      }
      modifyInputBox.doPost = function(){
        var prefix = "$RD_$" + 0 + "_";
        var dataPost = {};
        dataPost["method"] = "modify";
        dataPost[prefix+getRowDataIdName(modifyInputBox.input)] = modifyInputBox.targetID;
        dataPost[prefix+modifyInputBox.field] = modifyInputBox.value();
        dataPost["datatableName"]=$("#mainDataTable").attr("datatableName");
        $.post(window.location.pathname, dataPost);
      }
      modifyInputBox.eKeydwon = function(e){
        if(e.keyCode == 27){//ESC
          $(modifyInputBox.input).parent().text(modifyInputBox.originalValue);
          modifyInputBox.goHome();
        }else if(e.keyCode == 13){//Entry
          modifyInputBox.doPost();
          $(modifyInputBox.input).parent().text(modifyInputBox.value());
          modifyInputBox.goHome();
        }
      }
      $(modifyInputBox.input).live("keydown",modifyInputBox.eKeydwon); 

      function eModifyAjax(e){

        if(modifyInputBox.isEdit()){
          if(modifyInputBox.originalValue != modifyInputBox.value()){
            modifyInputBox.doPost();
          }
          $(modifyInputBox.input).parent().text(modifyInputBox.value());
          modifyInputBox.goHome();
        } else {
          modifyInputBox.originalValue = $(e.target).text();
          modifyInputBox.targetID = getRowDataIdValue(e.target); 
          modifyInputBox.field =  getColName(e.target);
          $(modifyInputBox.input).attr("value",modifyInputBox.originalValue);
          $(modifyInputBox.input).appendTo($(e.target).text("")).focus();
        }
      }
      $("table.datatable td[coltype='data']").dblclick(eModifyAjax);
      
    });
